export default {
  methods: {
    /**
     * 获取对象照片
     */
    getPrisonerImg (id) {
      return `http://38.145.205.142:9999/pic/${id}.jpg`
    },

    /**
     * 获取访客照片
     */
    getVisitorImg (uri) {
      return `http://38.145.205.142:8089/request/getImage?uri=${uri}`
    },

    /**
     * 获取默认照片
     */
    getDefaultImg (type) {
      let defaultSrc
      switch (type) {
        case 3:
          defaultSrc = require('@/assets/SelfHelp/img/lawyer.png')
          break
        case 4:
          defaultSrc = require('@/assets/SelfHelp/img/police.png')
          break
        case 5:
          defaultSrc = require('@/assets/SelfHelp/img/procuratorate.png')
          break
        case 6:
          defaultSrc = require('@/assets/SelfHelp/img/prisoner.png')
          break
      }
      return `javascript:this.src='${defaultSrc}'`
    }
  }
}
